package com.ynny.example03;

public class Student extends Person{
    public String no;
    public double scoreEn;
    public double scoreMath;
    public double scoreCh;
    public Student(){

    }

    public Student(String name, String sex, int age, String no, double scoreEn, double scoreMath, double scoreCh) {
        super(name, sex, age);
        this.no = no;
        this.scoreEn = scoreEn;
        this.scoreMath = scoreMath;
        this.scoreCh = scoreCh;
    }
    public double pingjun(){
        return (scoreCh + scoreMath + scoreEn)/3;

    }
    public double max(){
        return Math.max(Math.max(scoreEn,scoreMath),scoreCh);
    }
    public double min(){
        return Math.min(Math.min(scoreEn,scoreMath),scoreCh);
    }

    @Override
    public String toString() {
        return "Student{" +
                "no='" + no + '\'' +
                ", scoreEn=" + scoreEn +
                ", scoreMath=" + scoreMath +
                ", scoreCh=" + scoreCh +
                ", name='" + name + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                '}';
    }
}

